<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>6-是否在字符串头部和尾部出现</title>
</head>
<body>
    <script>
        let str = 'helloword!';
        var x = str.startsWith('hello');
        var y = str.endsWith('!');

        console.log(x);
        console.log(y);
    </script>
</body>
</html>